from random import*
import time


def read2list(filename):
    A = []
    for s in open(filename):
        A.append(int(s))
    start = time.time()
    swapped = True
    while swapped:
        swapped = False
        for i in range(len(A)-1):
            if A[i] > A[i+1]:
                A[i], A[i+1] = A[i+1],A[i]
                swapped = True
    finish = time.time()
    print(filename,round((finish-start)*1000),"miliseconds")
read2list("m1_sorted.txt")
read2list("m2_reverse.txt")
read2list("m3_shuffle.txt")